.class public Lcom/waiqin365/base/print/b;
.super Ljava/lang/Object;


# static fields
.field private static final a:Ljava/util/UUID;


# instance fields
.field private final b:Landroid/bluetooth/BluetoothAdapter;

.field private final c:Landroid/os/Handler;

.field private d:Lcom/waiqin365/base/print/c;

.field private e:Lcom/waiqin365/base/print/d;

.field private f:Lcom/waiqin365/base/print/e;

.field private g:I


# direct methods
.method static constructor <clinit>()V
    .locals 1

    const-string/jumbo v0, "00001101-0000-1000-8000-00805F9B34FB"

    invoke-static {v0}, Ljava/util/UUID;->fromString(Ljava/lang/String;)Ljava/util/UUID;

    move-result-object v0

    sput-object v0, Lcom/waiqin365/base/print/b;->a:Ljava/util/UUID;

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/os/Handler;)V
    .locals 1

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    invoke-static {}, Landroid/bluetooth/BluetoothAdapter;->getDefaultAdapter()Landroid/bluetooth/BluetoothAdapter;

    move-result-object v0

    iput-object v0, p0, Lcom/waiqin365/base/print/b;->b:Landroid/bluetooth/BluetoothAdapter;

    const/4 v0, 0x0

    iput v0, p0, Lcom/waiqin365/base/print/b;->g:I

    iput-object p2, p0, Lcom/waiqin365/base/print/b;->c:Landroid/os/Handler;

    return-void
.end method

.method static synthetic a(Lcom/waiqin365/base/print/b;)Landroid/bluetooth/BluetoothAdapter;
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/base/print/b;->b:Landroid/bluetooth/BluetoothAdapter;

    return-object v0
.end method

.method static synthetic a(Lcom/waiqin365/base/print/b;Lcom/waiqin365/base/print/d;)Lcom/waiqin365/base/print/d;
    .locals 0

    iput-object p1, p0, Lcom/waiqin365/base/print/b;->e:Lcom/waiqin365/base/print/d;

    return-object p1
.end method

.method private declared-synchronized a(I)V
    .locals 3

    monitor-enter p0

    :try_start_0
    iput p1, p0, Lcom/waiqin365/base/print/b;->g:I

    iget-object v0, p0, Lcom/waiqin365/base/print/b;->c:Landroid/os/Handler;

    const/4 v1, 0x1

    const/4 v2, -0x1

    invoke-virtual {v0, v1, p1, v2}, Landroid/os/Handler;->obtainMessage(III)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {v0}, Landroid/os/Message;->sendToTarget()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit p0

    return-void

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method static synthetic b(Lcom/waiqin365/base/print/b;)I
    .locals 1

    iget v0, p0, Lcom/waiqin365/base/print/b;->g:I

    return v0
.end method

.method static synthetic c(Lcom/waiqin365/base/print/b;)V
    .locals 0

    invoke-direct {p0}, Lcom/waiqin365/base/print/b;->j()V

    return-void
.end method

.method static synthetic d(Lcom/waiqin365/base/print/b;)Landroid/os/Handler;
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/base/print/b;->c:Landroid/os/Handler;

    return-object v0
.end method

.method static synthetic e(Lcom/waiqin365/base/print/b;)V
    .locals 0

    invoke-direct {p0}, Lcom/waiqin365/base/print/b;->k()V

    return-void
.end method

.method static synthetic i()Ljava/util/UUID;
    .locals 1

    sget-object v0, Lcom/waiqin365/base/print/b;->a:Ljava/util/UUID;

    return-object v0
.end method

.method private j()V
    .locals 2

    const/4 v0, 0x1

    invoke-direct {p0, v0}, Lcom/waiqin365/base/print/b;->a(I)V

    iget-object v0, p0, Lcom/waiqin365/base/print/b;->c:Landroid/os/Handler;

    const/4 v1, 0x6

    invoke-virtual {v0, v1}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message;

    move-result-object v0

    iget-object v1, p0, Lcom/waiqin365/base/print/b;->c:Landroid/os/Handler;

    invoke-virtual {v1, v0}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    return-void
.end method

.method private k()V
    .locals 2

    iget-object v0, p0, Lcom/waiqin365/base/print/b;->c:Landroid/os/Handler;

    const/4 v1, 0x5

    invoke-virtual {v0, v1}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message;

    move-result-object v0

    iget-object v1, p0, Lcom/waiqin365/base/print/b;->c:Landroid/os/Handler;

    invoke-virtual {v1, v0}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    return-void
.end method


# virtual methods
.method public declared-synchronized a(Ljava/lang/String;)Landroid/bluetooth/BluetoothDevice;
    .locals 1

    monitor-enter p0

    :try_start_0
    iget-object v0, p0, Lcom/waiqin365/base/print/b;->b:Landroid/bluetooth/BluetoothAdapter;

    invoke-virtual {v0, p1}, Landroid/bluetooth/BluetoothAdapter;->getRemoteDevice(Ljava/lang/String;)Landroid/bluetooth/BluetoothDevice;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result-object v0

    monitor-exit p0

    return-object v0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized a(Landroid/bluetooth/BluetoothDevice;)V
    .locals 4

    const/4 v3, 0x2

    monitor-enter p0

    :try_start_0
    const-string/jumbo v0, "BluetoothService"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v2, "connect to: "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    iget v0, p0, Lcom/waiqin365/base/print/b;->g:I

    if-ne v0, v3, :cond_0

    iget-object v0, p0, Lcom/waiqin365/base/print/b;->e:Lcom/waiqin365/base/print/d;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/waiqin365/base/print/b;->e:Lcom/waiqin365/base/print/d;

    invoke-virtual {v0}, Lcom/waiqin365/base/print/d;->cancel()V

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/waiqin365/base/print/b;->e:Lcom/waiqin365/base/print/d;

    :cond_0
    iget-object v0, p0, Lcom/waiqin365/base/print/b;->f:Lcom/waiqin365/base/print/e;

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/waiqin365/base/print/b;->f:Lcom/waiqin365/base/print/e;

    invoke-virtual {v0}, Lcom/waiqin365/base/print/e;->cancel()V

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/waiqin365/base/print/b;->f:Lcom/waiqin365/base/print/e;

    :cond_1
    new-instance v0, Lcom/waiqin365/base/print/d;

    invoke-direct {v0, p0, p1}, Lcom/waiqin365/base/print/d;-><init>(Lcom/waiqin365/base/print/b;Landroid/bluetooth/BluetoothDevice;)V

    iput-object v0, p0, Lcom/waiqin365/base/print/b;->e:Lcom/waiqin365/base/print/d;

    iget-object v0, p0, Lcom/waiqin365/base/print/b;->e:Lcom/waiqin365/base/print/d;

    invoke-virtual {v0}, Lcom/waiqin365/base/print/d;->start()V

    const/4 v0, 0x2

    invoke-direct {p0, v0}, Lcom/waiqin365/base/print/b;->a(I)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit p0

    return-void

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized a(Landroid/bluetooth/BluetoothSocket;Landroid/bluetooth/BluetoothDevice;)V
    .locals 2

    monitor-enter p0

    :try_start_0
    const-string/jumbo v0, "BluetoothService"

    const-string/jumbo v1, "connected"

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    iget-object v0, p0, Lcom/waiqin365/base/print/b;->e:Lcom/waiqin365/base/print/d;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/waiqin365/base/print/b;->e:Lcom/waiqin365/base/print/d;

    invoke-virtual {v0}, Lcom/waiqin365/base/print/d;->cancel()V

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/waiqin365/base/print/b;->e:Lcom/waiqin365/base/print/d;

    :cond_0
    iget-object v0, p0, Lcom/waiqin365/base/print/b;->f:Lcom/waiqin365/base/print/e;

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/waiqin365/base/print/b;->f:Lcom/waiqin365/base/print/e;

    invoke-virtual {v0}, Lcom/waiqin365/base/print/e;->cancel()V

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/waiqin365/base/print/b;->f:Lcom/waiqin365/base/print/e;

    :cond_1
    iget-object v0, p0, Lcom/waiqin365/base/print/b;->d:Lcom/waiqin365/base/print/c;

    if-eqz v0, :cond_2

    iget-object v0, p0, Lcom/waiqin365/base/print/b;->d:Lcom/waiqin365/base/print/c;

    invoke-virtual {v0}, Lcom/waiqin365/base/print/c;->cancel()V

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/waiqin365/base/print/b;->d:Lcom/waiqin365/base/print/c;

    :cond_2
    new-instance v0, Lcom/waiqin365/base/print/e;

    invoke-direct {v0, p0, p1}, Lcom/waiqin365/base/print/e;-><init>(Lcom/waiqin365/base/print/b;Landroid/bluetooth/BluetoothSocket;)V

    iput-object v0, p0, Lcom/waiqin365/base/print/b;->f:Lcom/waiqin365/base/print/e;

    iget-object v0, p0, Lcom/waiqin365/base/print/b;->f:Lcom/waiqin365/base/print/e;

    invoke-virtual {v0}, Lcom/waiqin365/base/print/e;->start()V

    iget-object v0, p0, Lcom/waiqin365/base/print/b;->c:Landroid/os/Handler;

    const/4 v1, 0x4

    invoke-virtual {v0, v1}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message;

    move-result-object v0

    iget-object v1, p0, Lcom/waiqin365/base/print/b;->c:Landroid/os/Handler;

    invoke-virtual {v1, v0}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    const/4 v0, 0x3

    invoke-direct {p0, v0}, Lcom/waiqin365/base/print/b;->a(I)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit p0

    return-void

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized a(Ljava/lang/String;Ljava/lang/String;)V
    .locals 4

    monitor-enter p0

    if-eqz p1, :cond_0

    :try_start_0
    invoke-virtual {p1}, Ljava/lang/String;->length()I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v0

    if-lez v0, :cond_0

    :try_start_1
    invoke-virtual {p1, p2}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B
    :try_end_1
    .catch Ljava/io/UnsupportedEncodingException; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    move-result-object v0

    :goto_0
    :try_start_2
    invoke-virtual {p0, v0}, Lcom/waiqin365/base/print/b;->a([B)V

    iget-object v0, p0, Lcom/waiqin365/base/print/b;->c:Landroid/os/Handler;

    const/4 v1, 0x7

    const/4 v2, -0x1

    const/4 v3, -0x1

    invoke-virtual {v0, v1, v2, v3}, Landroid/os/Handler;->obtainMessage(III)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {v0}, Landroid/os/Message;->sendToTarget()V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    :cond_0
    monitor-exit p0

    return-void

    :catch_0
    move-exception v0

    :try_start_3
    invoke-virtual {p1}, Ljava/lang/String;->getBytes()[B
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    move-result-object v0

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;)V
    .locals 4

    monitor-enter p0

    if-eqz p1, :cond_0

    :try_start_0
    invoke-virtual {p1}, Ljava/lang/String;->length()I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v0

    if-lez v0, :cond_0

    :try_start_1
    invoke-virtual {p1, p2}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B
    :try_end_1
    .catch Ljava/io/UnsupportedEncodingException; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    move-result-object v0

    :goto_0
    const/4 v1, 0x3

    :try_start_2
    new-array v1, v1, [B

    if-eqz p4, :cond_1

    const-string/jumbo v2, "center"

    invoke-virtual {v2, p4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_1

    const/4 v2, 0x0

    const/16 v3, 0x1b

    aput-byte v3, v1, v2

    const/4 v2, 0x1

    const/16 v3, 0x61

    aput-byte v3, v1, v2

    const/4 v2, 0x2

    const/16 v3, 0x31

    aput-byte v3, v1, v2

    invoke-virtual {p0, v1}, Lcom/waiqin365/base/print/b;->a([B)V

    :goto_1
    invoke-static {p3}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v2

    if-nez v2, :cond_3

    const-string/jumbo v2, "1"

    invoke-virtual {v2, p3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_3

    const/4 v2, 0x0

    const/16 v3, 0x1d

    aput-byte v3, v1, v2

    const/4 v2, 0x1

    const/16 v3, 0x21

    aput-byte v3, v1, v2

    const/4 v2, 0x2

    const/16 v3, 0x11

    aput-byte v3, v1, v2

    invoke-virtual {p0, v1}, Lcom/waiqin365/base/print/b;->a([B)V

    :goto_2
    invoke-virtual {p0, v0}, Lcom/waiqin365/base/print/b;->a([B)V

    const/4 v0, 0x0

    const/16 v2, 0x1b

    aput-byte v2, v1, v0

    const/4 v0, 0x1

    const/16 v2, 0x61

    aput-byte v2, v1, v0

    const/4 v0, 0x2

    const/16 v2, 0x30

    aput-byte v2, v1, v0

    invoke-virtual {p0, v1}, Lcom/waiqin365/base/print/b;->a([B)V

    const/4 v0, 0x0

    const/16 v2, 0x1d

    aput-byte v2, v1, v0

    const/4 v0, 0x1

    const/16 v2, 0x21

    aput-byte v2, v1, v0

    const/4 v0, 0x2

    const/4 v2, 0x0

    aput-byte v2, v1, v0

    invoke-virtual {p0, v1}, Lcom/waiqin365/base/print/b;->a([B)V

    if-eqz p5, :cond_0

    iget-object v0, p0, Lcom/waiqin365/base/print/b;->c:Landroid/os/Handler;

    const/4 v1, 0x7

    const/4 v2, -0x1

    const/4 v3, -0x1

    invoke-virtual {v0, v1, v2, v3}, Landroid/os/Handler;->obtainMessage(III)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {v0}, Landroid/os/Message;->sendToTarget()V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    :cond_0
    monitor-exit p0

    return-void

    :catch_0
    move-exception v0

    :try_start_3
    invoke-virtual {p1}, Ljava/lang/String;->getBytes()[B

    move-result-object v0

    goto :goto_0

    :cond_1
    if-eqz p4, :cond_2

    const-string/jumbo v2, "right"

    invoke-virtual {v2, p4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_2

    const/4 v2, 0x0

    const/16 v3, 0x1b

    aput-byte v3, v1, v2

    const/4 v2, 0x1

    const/16 v3, 0x61

    aput-byte v3, v1, v2

    const/4 v2, 0x2

    const/16 v3, 0x32

    aput-byte v3, v1, v2

    invoke-virtual {p0, v1}, Lcom/waiqin365/base/print/b;->a([B)V
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    goto :goto_1

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0

    :cond_2
    const/4 v2, 0x0

    const/16 v3, 0x1b

    :try_start_4
    aput-byte v3, v1, v2

    const/4 v2, 0x1

    const/16 v3, 0x61

    aput-byte v3, v1, v2

    const/4 v2, 0x2

    const/16 v3, 0x30

    aput-byte v3, v1, v2

    invoke-virtual {p0, v1}, Lcom/waiqin365/base/print/b;->a([B)V

    goto/16 :goto_1

    :cond_3
    const/4 v2, 0x0

    const/16 v3, 0x1d

    aput-byte v3, v1, v2

    const/4 v2, 0x1

    const/16 v3, 0x21

    aput-byte v3, v1, v2

    const/4 v2, 0x2

    const/4 v3, 0x0

    aput-byte v3, v1, v2

    invoke-virtual {p0, v1}, Lcom/waiqin365/base/print/b;->a([B)V
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_0

    goto/16 :goto_2
.end method

.method public declared-synchronized a(Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;)V
    .locals 4

    monitor-enter p0

    if-eqz p1, :cond_0

    :try_start_0
    invoke-virtual {p1}, Ljava/lang/String;->length()I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v0

    if-lez v0, :cond_0

    :try_start_1
    invoke-virtual {p1, p2}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B
    :try_end_1
    .catch Ljava/io/UnsupportedEncodingException; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    move-result-object v0

    :goto_0
    :try_start_2
    invoke-virtual {p0, v0}, Lcom/waiqin365/base/print/b;->a([B)V

    if-eqz p3, :cond_0

    new-instance v0, Lcom/waiqin365/lightapp/view/a/a;

    invoke-direct {v0}, Lcom/waiqin365/lightapp/view/a/a;-><init>()V

    iput-object p4, v0, Lcom/waiqin365/lightapp/view/a/a;->a:Ljava/lang/String;

    iput-object p4, v0, Lcom/waiqin365/lightapp/view/a/a;->b:Ljava/lang/Object;

    invoke-static {}, Lcom/waiqin365/lightapp/view/a/b;->a()Ljava/util/Observable;

    move-result-object v1

    invoke-virtual {v1, v0}, Ljava/util/Observable;->notifyObservers(Ljava/lang/Object;)V

    iget-object v0, p0, Lcom/waiqin365/base/print/b;->c:Landroid/os/Handler;

    const/4 v1, 0x7

    const/4 v2, -0x1

    const/4 v3, -0x1

    invoke-virtual {v0, v1, v2, v3}, Landroid/os/Handler;->obtainMessage(III)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {v0}, Landroid/os/Message;->sendToTarget()V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    :cond_0
    monitor-exit p0

    return-void

    :catch_0
    move-exception v0

    :try_start_3
    invoke-virtual {p1}, Ljava/lang/String;->getBytes()[B
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    move-result-object v0

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public a([B)V
    .locals 2

    monitor-enter p0

    :try_start_0
    iget v0, p0, Lcom/waiqin365/base/print/b;->g:I

    const/4 v1, 0x3

    if-eq v0, v1, :cond_0

    monitor-exit p0

    :goto_0
    return-void

    :cond_0
    iget-object v0, p0, Lcom/waiqin365/base/print/b;->f:Lcom/waiqin365/base/print/e;

    monitor-exit p0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    invoke-virtual {v0, p1}, Lcom/waiqin365/base/print/e;->a([B)V

    goto :goto_0

    :catchall_0
    move-exception v0

    :try_start_1
    monitor-exit p0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v0
.end method

.method public declared-synchronized a()Z
    .locals 1

    monitor-enter p0

    :try_start_0
    iget-object v0, p0, Lcom/waiqin365/base/print/b;->b:Landroid/bluetooth/BluetoothAdapter;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    if-nez v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    monitor-exit p0

    return v0

    :cond_0
    const/4 v0, 0x1

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized b(Ljava/lang/String;Ljava/lang/String;)V
    .locals 4

    monitor-enter p0

    if-eqz p1, :cond_0

    :try_start_0
    invoke-virtual {p1}, Ljava/lang/String;->length()I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v0

    if-lez v0, :cond_0

    :try_start_1
    invoke-virtual {p1, p2}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B
    :try_end_1
    .catch Ljava/io/UnsupportedEncodingException; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    move-result-object v0

    :goto_0
    const/4 v1, 0x3

    :try_start_2
    new-array v1, v1, [B

    const/4 v2, 0x0

    const/16 v3, 0x1b

    aput-byte v3, v1, v2

    const/4 v2, 0x1

    const/16 v3, 0x61

    aput-byte v3, v1, v2

    const/4 v2, 0x2

    const/16 v3, 0x31

    aput-byte v3, v1, v2

    invoke-virtual {p0, v1}, Lcom/waiqin365/base/print/b;->a([B)V

    const/4 v2, 0x0

    const/16 v3, 0x1d

    aput-byte v3, v1, v2

    const/4 v2, 0x1

    const/16 v3, 0x21

    aput-byte v3, v1, v2

    const/4 v2, 0x2

    const/16 v3, 0x11

    aput-byte v3, v1, v2

    invoke-virtual {p0, v1}, Lcom/waiqin365/base/print/b;->a([B)V

    invoke-virtual {p0, v0}, Lcom/waiqin365/base/print/b;->a([B)V

    const/4 v0, 0x0

    const/16 v2, 0x1b

    aput-byte v2, v1, v0

    const/4 v0, 0x1

    const/16 v2, 0x61

    aput-byte v2, v1, v0

    const/4 v0, 0x2

    const/16 v2, 0x30

    aput-byte v2, v1, v0

    invoke-virtual {p0, v1}, Lcom/waiqin365/base/print/b;->a([B)V

    const/4 v0, 0x0

    const/16 v2, 0x1d

    aput-byte v2, v1, v0

    const/4 v0, 0x1

    const/16 v2, 0x21

    aput-byte v2, v1, v0

    const/4 v0, 0x2

    const/4 v2, 0x0

    aput-byte v2, v1, v0

    invoke-virtual {p0, v1}, Lcom/waiqin365/base/print/b;->a([B)V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    :cond_0
    monitor-exit p0

    return-void

    :catch_0
    move-exception v0

    :try_start_3
    invoke-virtual {p1}, Ljava/lang/String;->getBytes()[B
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    move-result-object v0

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized b(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;)V
    .locals 4

    monitor-enter p0

    if-eqz p1, :cond_0

    :try_start_0
    invoke-virtual {p1}, Ljava/lang/String;->length()I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v0

    if-lez v0, :cond_0

    :try_start_1
    invoke-virtual {p1, p2}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B
    :try_end_1
    .catch Ljava/io/UnsupportedEncodingException; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    move-result-object v0

    :goto_0
    const/4 v1, 0x3

    :try_start_2
    new-array v1, v1, [B

    if-eqz p4, :cond_1

    const-string/jumbo v2, "center"

    invoke-virtual {v2, p4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_1

    const/4 v2, 0x0

    const/16 v3, 0x1b

    aput-byte v3, v1, v2

    const/4 v2, 0x1

    const/16 v3, 0x61

    aput-byte v3, v1, v2

    const/4 v2, 0x2

    const/16 v3, 0x31

    aput-byte v3, v1, v2

    invoke-virtual {p0, v1}, Lcom/waiqin365/base/print/b;->a([B)V

    :goto_1
    invoke-static {p3}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v2

    if-nez v2, :cond_3

    const-string/jumbo v2, "0"

    invoke-virtual {v2, p3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_3

    const/4 v2, 0x0

    const/16 v3, 0x1d

    aput-byte v3, v1, v2

    const/4 v2, 0x1

    const/16 v3, 0x21

    aput-byte v3, v1, v2

    const/4 v2, 0x2

    const/4 v3, 0x0

    aput-byte v3, v1, v2

    invoke-virtual {p0, v1}, Lcom/waiqin365/base/print/b;->a([B)V

    :goto_2
    invoke-virtual {p0, v0}, Lcom/waiqin365/base/print/b;->a([B)V

    const/4 v0, 0x0

    const/16 v2, 0x1b

    aput-byte v2, v1, v0

    const/4 v0, 0x1

    const/16 v2, 0x61

    aput-byte v2, v1, v0

    const/4 v0, 0x2

    const/16 v2, 0x30

    aput-byte v2, v1, v0

    invoke-virtual {p0, v1}, Lcom/waiqin365/base/print/b;->a([B)V

    const/4 v0, 0x0

    const/16 v2, 0x1d

    aput-byte v2, v1, v0

    const/4 v0, 0x1

    const/16 v2, 0x21

    aput-byte v2, v1, v0

    const/4 v0, 0x2

    const/4 v2, 0x0

    aput-byte v2, v1, v0

    invoke-virtual {p0, v1}, Lcom/waiqin365/base/print/b;->a([B)V

    if-eqz p5, :cond_0

    iget-object v0, p0, Lcom/waiqin365/base/print/b;->c:Landroid/os/Handler;

    const/4 v1, 0x7

    const/4 v2, -0x1

    const/4 v3, -0x1

    invoke-virtual {v0, v1, v2, v3}, Landroid/os/Handler;->obtainMessage(III)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {v0}, Landroid/os/Message;->sendToTarget()V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    :cond_0
    monitor-exit p0

    return-void

    :catch_0
    move-exception v0

    :try_start_3
    invoke-virtual {p1}, Ljava/lang/String;->getBytes()[B

    move-result-object v0

    goto :goto_0

    :cond_1
    if-eqz p4, :cond_2

    const-string/jumbo v2, "right"

    invoke-virtual {v2, p4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_2

    const/4 v2, 0x0

    const/16 v3, 0x1b

    aput-byte v3, v1, v2

    const/4 v2, 0x1

    const/16 v3, 0x61

    aput-byte v3, v1, v2

    const/4 v2, 0x2

    const/16 v3, 0x32

    aput-byte v3, v1, v2

    invoke-virtual {p0, v1}, Lcom/waiqin365/base/print/b;->a([B)V
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    goto :goto_1

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0

    :cond_2
    const/4 v2, 0x0

    const/16 v3, 0x1b

    :try_start_4
    aput-byte v3, v1, v2

    const/4 v2, 0x1

    const/16 v3, 0x61

    aput-byte v3, v1, v2

    const/4 v2, 0x2

    const/16 v3, 0x30

    aput-byte v3, v1, v2

    invoke-virtual {p0, v1}, Lcom/waiqin365/base/print/b;->a([B)V

    goto/16 :goto_1

    :cond_3
    const/4 v2, 0x0

    const/16 v3, 0x1d

    aput-byte v3, v1, v2

    const/4 v2, 0x1

    const/16 v3, 0x21

    aput-byte v3, v1, v2

    const/4 v2, 0x2

    const/16 v3, 0x11

    aput-byte v3, v1, v2

    invoke-virtual {p0, v1}, Lcom/waiqin365/base/print/b;->a([B)V
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_0

    goto/16 :goto_2
.end method

.method public declared-synchronized b(Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;)V
    .locals 4

    monitor-enter p0

    if-eqz p1, :cond_0

    :try_start_0
    invoke-virtual {p1}, Ljava/lang/String;->length()I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v0

    if-lez v0, :cond_0

    :try_start_1
    invoke-virtual {p1, p2}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B
    :try_end_1
    .catch Ljava/io/UnsupportedEncodingException; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    move-result-object v0

    :goto_0
    const/4 v1, 0x3

    :try_start_2
    new-array v1, v1, [B

    const/4 v2, 0x0

    const/16 v3, 0x1b

    aput-byte v3, v1, v2

    const/4 v2, 0x1

    const/16 v3, 0x61

    aput-byte v3, v1, v2

    const/4 v2, 0x2

    const/16 v3, 0x31

    aput-byte v3, v1, v2

    invoke-virtual {p0, v1}, Lcom/waiqin365/base/print/b;->a([B)V

    const/4 v2, 0x0

    const/16 v3, 0x1d

    aput-byte v3, v1, v2

    const/4 v2, 0x1

    const/16 v3, 0x21

    aput-byte v3, v1, v2

    const/4 v2, 0x2

    const/16 v3, 0x11

    aput-byte v3, v1, v2

    invoke-virtual {p0, v1}, Lcom/waiqin365/base/print/b;->a([B)V

    invoke-virtual {p0, v0}, Lcom/waiqin365/base/print/b;->a([B)V

    const/4 v0, 0x0

    const/16 v2, 0x1b

    aput-byte v2, v1, v0

    const/4 v0, 0x1

    const/16 v2, 0x61

    aput-byte v2, v1, v0

    const/4 v0, 0x2

    const/16 v2, 0x30

    aput-byte v2, v1, v0

    invoke-virtual {p0, v1}, Lcom/waiqin365/base/print/b;->a([B)V

    const/4 v0, 0x0

    const/16 v2, 0x1d

    aput-byte v2, v1, v0

    const/4 v0, 0x1

    const/16 v2, 0x21

    aput-byte v2, v1, v0

    const/4 v0, 0x2

    const/4 v2, 0x0

    aput-byte v2, v1, v0

    invoke-virtual {p0, v1}, Lcom/waiqin365/base/print/b;->a([B)V

    if-eqz p3, :cond_0

    iget-object v0, p0, Lcom/waiqin365/base/print/b;->c:Landroid/os/Handler;

    const/4 v1, 0x7

    const/4 v2, -0x1

    const/4 v3, -0x1

    invoke-virtual {v0, v1, v2, v3}, Landroid/os/Handler;->obtainMessage(III)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {v0}, Landroid/os/Message;->sendToTarget()V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    :cond_0
    monitor-exit p0

    return-void

    :catch_0
    move-exception v0

    :try_start_3
    invoke-virtual {p1}, Ljava/lang/String;->getBytes()[B
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    move-result-object v0

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized b()Z
    .locals 1

    monitor-enter p0

    :try_start_0
    iget-object v0, p0, Lcom/waiqin365/base/print/b;->b:Landroid/bluetooth/BluetoothAdapter;

    invoke-virtual {v0}, Landroid/bluetooth/BluetoothAdapter;->isEnabled()Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v0

    if-nez v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    monitor-exit p0

    return v0

    :cond_0
    const/4 v0, 0x1

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized c()Ljava/util/Set;
    .locals 1

    monitor-enter p0

    :try_start_0
    iget-object v0, p0, Lcom/waiqin365/base/print/b;->b:Landroid/bluetooth/BluetoothAdapter;

    invoke-virtual {v0}, Landroid/bluetooth/BluetoothAdapter;->getBondedDevices()Ljava/util/Set;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result-object v0

    monitor-exit p0

    return-object v0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized d()Z
    .locals 1

    monitor-enter p0

    :try_start_0
    iget-object v0, p0, Lcom/waiqin365/base/print/b;->b:Landroid/bluetooth/BluetoothAdapter;

    invoke-virtual {v0}, Landroid/bluetooth/BluetoothAdapter;->cancelDiscovery()Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v0

    monitor-exit p0

    return v0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized e()Z
    .locals 1

    monitor-enter p0

    :try_start_0
    iget-object v0, p0, Lcom/waiqin365/base/print/b;->b:Landroid/bluetooth/BluetoothAdapter;

    invoke-virtual {v0}, Landroid/bluetooth/BluetoothAdapter;->isDiscovering()Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v0

    monitor-exit p0

    return v0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized f()Z
    .locals 1

    monitor-enter p0

    :try_start_0
    iget-object v0, p0, Lcom/waiqin365/base/print/b;->b:Landroid/bluetooth/BluetoothAdapter;

    invoke-virtual {v0}, Landroid/bluetooth/BluetoothAdapter;->startDiscovery()Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v0

    monitor-exit p0

    return v0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized g()I
    .locals 1

    monitor-enter p0

    :try_start_0
    iget v0, p0, Lcom/waiqin365/base/print/b;->g:I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit p0

    return v0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized h()V
    .locals 2

    monitor-enter p0

    :try_start_0
    const-string/jumbo v0, "BluetoothService"

    const-string/jumbo v1, "start"

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    iget-object v0, p0, Lcom/waiqin365/base/print/b;->e:Lcom/waiqin365/base/print/d;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/waiqin365/base/print/b;->e:Lcom/waiqin365/base/print/d;

    invoke-virtual {v0}, Lcom/waiqin365/base/print/d;->cancel()V

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/waiqin365/base/print/b;->e:Lcom/waiqin365/base/print/d;

    :cond_0
    iget-object v0, p0, Lcom/waiqin365/base/print/b;->f:Lcom/waiqin365/base/print/e;

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/waiqin365/base/print/b;->f:Lcom/waiqin365/base/print/e;

    invoke-virtual {v0}, Lcom/waiqin365/base/print/e;->cancel()V

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/waiqin365/base/print/b;->f:Lcom/waiqin365/base/print/e;

    :cond_1
    iget-object v0, p0, Lcom/waiqin365/base/print/b;->d:Lcom/waiqin365/base/print/c;

    if-nez v0, :cond_2

    new-instance v0, Lcom/waiqin365/base/print/c;

    invoke-direct {v0, p0}, Lcom/waiqin365/base/print/c;-><init>(Lcom/waiqin365/base/print/b;)V

    iput-object v0, p0, Lcom/waiqin365/base/print/b;->d:Lcom/waiqin365/base/print/c;

    iget-object v0, p0, Lcom/waiqin365/base/print/b;->d:Lcom/waiqin365/base/print/c;

    invoke-virtual {v0}, Lcom/waiqin365/base/print/c;->start()V

    :cond_2
    const/4 v0, 0x1

    invoke-direct {p0, v0}, Lcom/waiqin365/base/print/b;->a(I)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit p0

    return-void

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method
